package top.gbiot.scan.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.gbiot.scan.entity.ApiTemplate;
import top.gbiot.scan.entity.DeviceTemplate;
import top.gbiot.scan.mapper.CreateDeviceMapper;
import top.gbiot.scan.entity.Device;

import java.util.List;

@Service
public class IoTableService {

    @Autowired
    CreateDeviceMapper createDeviceMapper;

    public void createTable(){
        createDeviceMapper.createTable();
    }

    public void insertTableDevice(Device device) {
        createDeviceMapper.insertTableDevice(device);
    }

    public void createTemplateTable(){
        createDeviceMapper.createTemplateTable();

    }

    public void insertTemplate(DeviceTemplate dt){
       createDeviceMapper.insertTemplate(dt);
    }

    public void truncateTemplate(){
        createDeviceMapper.truncateTemplate();
    }

    public List<ApiTemplate> selectApiTemplate(){
       return createDeviceMapper.selectApiTemplate();
    }


}
